describe('Testing list-group-directive', function(){
    var element, scope,  compile, view;

    var items = [
        {text: 'Item One', cls: '1'},
        {text: 'Item 2', cls: '2'},
        {text: 'Item 31', cls: '3'}
    ];

    var classes = [
        'primary', 'success',
        'info', 'warning', 'danger'
    ];

    beforeEach(module('MyApp'));
    beforeEach(module('templates'));
    beforeEach(inject(function($compile, $rootScope){
        compile = $compile;
        scope = $rootScope;
        scope.myItems = items;

        scope.classes = classes;

        element = angular.element('<list-group items="myItems" classes="classes"></list-group>');
        view = compile(element)(scope);

        scope.$digest();
    }));

    it ('test item.length == count of li-s in the widget', function() {
        expect(element.find('li').length).toBe(items.length);
    });

    it('test if all options are equal to classes.length', function() {
        expect(element.find('li')[0].querySelectorAll('option').length).toBe(classes.length + 1);
    })

})